"""
文件: share.py
功能: 共享变量
"""

from multiprocessing import Process, Value


def worker(num):
    num.value += 10


if __name__ == "__main__":
    number = Value("i", 5)  # 'i' 表示整型
    p = Process(target=worker, args=(number,))
    p.start()
    p.join()
    print("share var =", number.value)
